/**
 * 
 */
package pt.inescid.components.commons;

/**
 * @author Sergio Esteves (sesteves at gsd.inesc-id.pt)
 *
 */
public class Resources {

	private double cpu = 0, mem = 0, bw = 0; 
	private long storage = 0;
	
	public Resources() {
	}
	
	public Resources(double cpu, double mem, double bw, long storage) {
		setAll(cpu, mem, bw, storage);
	}
	
	public void setAll(double cpu, double mem, double bw, long storage) {
		this.cpu = cpu;
		this.mem = mem;
		this.bw = bw;
		this.storage = storage;
	}
	
	public void updateCPU(double cpu) {
		this.cpu += cpu;
	}
	public void updateMem(double mem) {
		this.mem += mem;
	}
	public void updateBW(double bw) {
		this.bw = bw;
	}
	public void setCPU(double cpu) {
		this.cpu = cpu;
	}
	public void setMem(double mem) {
		this.mem = mem;
	}
	public void setBW(double bw) {
		this.bw = bw;
	}
	public void setStorage(long storage) {
		this.storage = storage;
	}

	public double getCPU() {
		return cpu;
	}
	public double getMem() {
		return mem;
	}
	public double getBW() {
		return bw;
	}
	public long getStorage() {
		return storage;
	}
	
	public String toString() {
		return "Resources-> CPU: " + cpu + ", MEM: " + mem + ", BW: " + bw +
			", storage: " + storage;
	}
}
